package com.jqsoft.launcher.util;

import com.jqsoft.launcher.common.BphsURL;

import org.apache.commons.lang.StringUtils;
import org.apache.http.protocol.HTTP;
import org.json.JSONException;
import org.json.JSONObject;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.SoapFault;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;

/**
 * 服务器交互类
 * 
 * @author gujunqi date：2014-1-1
 */
public class WebServiceUtils {
	// 定义webservice的命名空间
	public static String nameSpace = "http://tempuri.org/";

	// 定义webservice提供服务的url
	// public static String serviceURL =
	// "http://60.171.146.122:9098/WebService/AndrewsWebService.asmx";

	// 传入 调用 的方法 此方法不需传参
	public static String requestNoParams(String methodName, String serviceURL) {
		// 创建HttpTransportSE传输对象
		HttpTransportSE ht = new HttpTransportSE(serviceURL);
		try {
			ht.debug = true;
			// 使用SOAP1.1协议创建Envelop对象
			SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
					SoapEnvelope.VER11);
			// 实例化SoapObject对象
			SoapObject soapObject = new SoapObject(nameSpace, methodName);
			envelope.bodyOut = soapObject;
			// 设置与.NET提供的webservice保持较好的兼容性
			envelope.dotNet = true;

			// 调用webservice
			ht.call(nameSpace + methodName, envelope);
			if (envelope.getResponse() != null) {
				// 获取服务器响应返回的SOAP消息
				SoapObject object = (SoapObject) envelope.bodyIn;
				String result = object.getProperty(0).toString();
				return result;
			}
		} catch (SoapFault e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (XmlPullParserException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	public static String requestSpecificECG(){
		String methodName = "AddToECGTB";
		String requestUrl = "http://192.168.88.83:8081/WebService/Andrews/ECGTBWebService.asmx";
		String strJson = "{\"hr\":59,\"And_xuetang\":\"0\",\"qrsDuration\":122,\"pAxis\":92,\"hp\":7,\"dAddTime\":\"2017-11-23 11:20:23\",\"And_xueya\":\"0\",\"lp\":6,\"taxis\":-122,\"And_xinlv\":\"1\",\"sAreaCode\":\"340122100011\",\"notch\":2,\"sECGResult\":\"[** 异常心电图 **, 窦性心律, 频发性室性期前收缩, 陈旧性前壁心肌梗死待排, 电轴左偏]\",\"And_xindian\":\"1\",\"resultCodes\":\"9140, 1100, 1574, 3113, 7200, -1, -1, -1, -1, -1\",\"sCardNo\":\"34012319500311278x\",\"sAddUser\":\"110921004502\",\"sECGData\":\"VgBSADgAPQA\\/AD0AQgBIADUAUgBIAEgASQBEAD0AQQBFAEcAOQBBAGQAZwBbAEIASQBBAEAAUgBNAFMAUQBpAHEAZABeAGEAWgB0AHsAWABeAHIAfwCSAIQAlABwAI8AnQCoAKQAkwCMAJ8AiQCmAIkAmwCxAKcAiACtAJIAnACiALYApgC0AK8AkwB4ALAAjAB\\/AI0AcwB3AJMAcwByAHIAgwBnAIUAfgBwAFwAjQAqADMAZwBbAFEAUgBvAG4AWQBPAGEAXQBOAGUAXABxAE0AYQBHAJYAcAChAIQAeABqAHoAgABwAIkAjAB7AHoAjgCRAHgAWQB0AGIAiACOAIUAfQB9AIcAeACIAHEAfgCHAGYAZQBtADIARgA8ABUADgA3AI8ApQCLAMUA1QDMAL8AkgBjAFIAtADiADMBqQHHAbUBrAFvATQBJwErAQMBDgH5AOgArgChAJEAiACHAD0AWwBqAFYAVABXAGMAWABoAD8AaQB\\/AHIAXQBVAEsAbABYAEgAWwBaADsAYQBJAFUAVABPAFAARwBFAFIAVABuAE4AVQBPAFYAWABpAFcAWwBJADUANABFAEwAVABJAGYAUwBWADQALgBGAGIAXABEAGoALABtAFMAMgBAAHUAYABJAEEARwBPAFIARQBEAE0ATAA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AVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUA\",\"And_huxipinlv\":\"0\",\"inputDate\":\"2017-11-23\",\"prInterval\":126,\"sNo\":\"34012210001127503\",\"IsService\":\"0\",\"pWidth\":72,\"sInputDeptCode\":\"d9b14ed5-9fa3-4f3e-ba10-5ba6c6d2a391\",\"sPersonName\":\"黄太琴\",\"sv1\":-0.02800000086426735,\"rv5sv1\":0.02800000086426735,\"And_tiwen\":\"0\",\"And_mailv\":\"0\",\"And_xuehongdanbai\":\"0\",\"inputer\":\"110921004502\",\"sDoctorName\":\"\",\"rv5\":0,\"qrsAxis\":-72,\"sInputDeptName\":\"西山驿村卫生室\",\"pExist\":0,\"sPersonID\":\"010023ad-74af-49fc-8146-6c6ce8d3ae16\",\"qtd\":468,\"qtc\":464}";
		String result =  requestByParams(methodName, strJson, requestUrl);
		return result;
	}

	public static InputStream requestByRaw(String methodName, String strJson,
									  String serviceURL) {
		InputStream in = null;
		try {
			String SOAP_ACTION_ITEM_DATA = "http://tempuri.org/"+methodName;
			int BUFFER_SIZE = 2048;
			java.net.URL url = new java.net.URL(serviceURL);
			HttpURLConnection rc = (HttpURLConnection) url.openConnection();
			rc.setRequestMethod("POST");

			rc.setDoOutput(true);
			rc.setDoInput(true);


			rc.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
			rc.addRequestProperty("User-Agent", HTTP.USER_AGENT);
			rc.setRequestProperty("SOAPAction", SOAP_ACTION_ITEM_DATA);
			OutputStream out = rc.getOutputStream();
			Writer wout;
			wout = new OutputStreamWriter(out);
			wout.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
			wout.write("<v:Envelope xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:d=\"http://www.w3.org/2001/XMLSchema\" xmlns:c=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:v=\"http://schemas.xmlsoap.org/soap/envelope/\">");
			wout.write("<v:Header />");
			wout.write("<v:Body>");
			wout.write("<GetHypertensionManageData xmlns=\"http://tempuri.org/\"  id=\"o0\" c:root=\"1\">");
			wout.write("<strJson i:type=\"d:string\">"+strJson+ "</strJson>");
			wout.write("</GetHypertensionManageData>");
			wout.write("</v:Body>");
			wout.write("</v:Envelope>");
			wout.flush();
			wout.close();
			rc.connect();

			Log.d("==CLIENT==", "responsecode: " + rc.getResponseCode() + " " + rc.getResponseMessage());
			in = new BufferedInputStream(rc.getInputStream(), BUFFER_SIZE);
		} catch (ProtocolException e) {
			e.printStackTrace();
			in = null;
		} catch (MalformedURLException e) {
			e.printStackTrace();
			in = null;
		} catch (IOException e) {
			e.printStackTrace();
			in = null;
		}
		return in;
	}

	// 需要传参类
	// 传入 调用的方法
	public static String requestByParams(String methodName, String strJson,
			String serviceURL) {
		// 创建httptransportSE传输对象
		HttpTransportSE ht = new HttpTransportSE(serviceURL);
		ht.debug = true;
		// 实例化SoapObject对象
		SoapObject soapObject = new SoapObject(nameSpace, methodName);
		// 添加一个请求参数
		// soapObject.addProperty("sLoginName", "admin");
		// soapObject.addProperty("sPassword", "123");
		soapObject.addProperty("strJson", strJson);
		// 使用soap1.1协议创建envelop对象
//		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
//				SoapEnvelope.VER10);
		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
				SoapEnvelope.VER11);
		envelope.bodyOut = soapObject;
		// 设置与.NET提供的webservice保持较好的兼容性
		envelope.dotNet = true;

		// 调用webservice
		try {
			ht.call(nameSpace + methodName, envelope);
			if (envelope.getResponse() != null) {
				// 获取服务器响应返回的SOAP消息
				SoapObject object = (SoapObject) envelope.bodyIn;
				String result = object.getProperty(0).toString();
				return result;
			}
		} catch (SoapFault e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (XmlPullParserException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	// 上次随调的接口 传参数返回值
	public static String requestSuifang(String sPersonID, String suifangType) {
		JSONObject data = new JSONObject();
		try {
			data.put("iCurrentPageIndex", "1");
			data.put("iPageSize", "10"); //
			data.put("sPersonID", sPersonID); //
		} catch (JSONException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		String result = null;
		if ("1".equals(suifangType)) {
			String requestUrl = BphsURL.getCommonPath("GetHypertensionManageData_URL");
//			String requestUrl = "http://192.168.44.163:9099/WebService/Andrews/HypertensionWebService.asmx";
			String methodName = "GetLastVisiting";
			String content = WebServiceUtils.requestByParams(methodName,
					data.toString(), requestUrl);
			result = gxyMakeJson(content);
		}else if("2".equals(suifangType)){
			String requestUrl = BphsURL.getCommonPath("GetType2Diabetes_URL");
//			String requestUrl = "http://192.168.44.163:9099/WebService/Andrews/Type2DiabetesWebService.asmx";
			String methodName = "GetLastVisiting";
			String content = WebServiceUtils.requestByParams(methodName,
					data.toString(), requestUrl);
			result = gxyMakeJson(content);
		}else{
			String requestUrl = BphsURL.getCommonPath("GetPsychosisPersonManage_URL");
//			String requestUrl = "http://192.168.44.163:9099/WebService/Andrews/PsychosisPersonWebService.asmx";
			String methodName = "GetLastVisiting";
			String content = WebServiceUtils.requestByParams(methodName,
					data.toString(), requestUrl);
			result = gxyMakeJson(content);
		
			
		}
		return result;
	}

	// 高血压组装的json
	public static String gxyMakeJson(String content) {
		if (StringUtils.isNotBlank(content)) {
			JSONObject json;
			try {
				json = new JSONObject(content);
				String sResult = json.getString("sSuccess");
				String sMessage = json.getString("sMessage");
				String data = json.getString("Data");
				String AllCount = json.getString("AllCount");
				return data+"*"+AllCount;
			} catch (JSONException e) {
				e.printStackTrace();
				
			}
		}
		return null;
	}
	 public static String StringSplit(String value){
		 String[] names = value.split("\\*");
	        for (int i = 0; i < names.length; i++) {
	            System.out.println(names[i]);
	        }
		 return names[0] ;
	 }
	 public static String StringSplit2(String value){
		 String[] names = value.split("\\*");
	        for (int i = 0; i < names.length; i++) {
	            System.out.println(names[i]);
	        }
		 return names[1] ;
	 }
}
